package com.dainel.snake;

import javax.swing.*;
import java.net.URL;

/**
 * 详细说明
 *
 * @author Daniel
 * @version V1.0
 * @date 2020/5/13 10:08
 */
public class Data {

	public static ImageIcon header = new ImageIcon(getStaticsResource("header.png"));

	public static ImageIcon up = new ImageIcon(getStaticsResource("up.png"));

	public static ImageIcon down = new ImageIcon(getStaticsResource("down.png"));

	public static ImageIcon left = new ImageIcon(getStaticsResource("left.png"));

	public static ImageIcon right = new ImageIcon(getStaticsResource("right.png"));

	public static ImageIcon body = new ImageIcon(getStaticsResource("body.png"));

	public static ImageIcon food = new ImageIcon(getStaticsResource("food.png"));

	/**
	 * 获取静态资源地址
	 *
	 * @param fileName 文件名称
	 * @return URL
	 */
	private static URL getStaticsResource(String fileName) {
		return Data.class.getResource("/statics/" + fileName);
	}
}
